<?xml version="1.0" encoding="utf-8" ?>
[#include "/WEB-INF/pages/common/taglibs.ftl"]
[#macro _script]
	<script type="text/javascript">
		var base = (function(){
			// 事件绑定
			function _addEventListeners() {
				// 维护
				$('a[act=edit]').unbind('click').click(function(){
					var id = $(this).parent().attr('tval');
					[@c.url var="editUrl" value='/manage/Member_edit.action' scope="page"]
						[@c.param name="currentPage" value="${currentPage}"/]
					[/@c.url]
					var url = "${editUrl}&id=" + id;
					//$.get(url, {'id':id, 'ajax':'true'}, function(data) {
					//	$('#body').html(data);
					//})
					window.location = url;
				})
				
				// 删除
				$('a[act=delete]').unbind('click').click(function(){
					var id = $(this).parent().attr('tval');
					$( "#delete-confirm" ).dialog({
						resizable: false,
						height:160,
						width:260,
						modal: true,
						buttons: {
							"删除": function() {
								[@c.url var="backUrl" value='/manage/Member_list.action' scope="page"]
									[@c.param name="currentPage" value="${currentPage}"/]
								[/@c.url]
								window.location = "[@c.url value='/manage/Member_delete.action?id='/]" + id + "&backurl=${backUrl}";
								$( this ).dialog( "close" );
							},
							"取消": function() {
								$( this ).dialog( "close" );
							}
						}
					});
					$( "#delete:ui-dialog" ).dialog( "destroy" );
					return false;
				})
				
				// Create jqxExpander
        		$('.jqxExpander').jqxExpander({showArrow: false, toggleMode: 'none', height: '500px', theme: base.config.theme });
			}
			return {
                config: {
                	url : null,
                    theme: null
                },
                init: function () {
                	_addEventListeners();
                }
			}
		}());
		
		$(function(){
			var link = "[@c.url value='/manage/Member_list.action?currentPage=${currentPage}' /]";
			base.config.theme = getTheme();
			base.config.url = link;
            //Initializing the form
			base.init();
		})
	</script>
[/#macro]
[#if piece==true]
	[@_script /]
	<!--设置提交行为-->
	[#assign act="save" /]
	<!--设置table渲染到指定ID节点-->
	[#assign renderTo="#articleList"]
	[#include "/WEB-INF/pages/manage/_memberList.ftl"]
[#else]
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Insert title here</title>
		<meta name="menu" content="AdminMenu"/>
		<meta name="heading" content="heading"/>
		<style type="text/css">
			.member {
				padding:0;
				margain:0;
			}
			.member_list {
				/*height:500px;*/
				/*margin-left:252px;*/
			}
		</style>
		[@_script /]
	</head>
	<body id="body" class="member_content">
		<div class="member">
			<div id="memberList" class="member_list">
				<!--设置提交行为-->
				[#assign act="save" /]
				<!--设置table渲染到指定ID节点-->
				[#assign renderTo="#memberList"]
				[#include "/WEB-INF/pages/manage/_memberList.ftl"]
			</div>
			<div style="clear: both;"></div>
		</div>
	</body>
	</html>
[/#if]